<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>

  <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form id="from">
  <input type="hidden" name="pid" th:value="${person.pid}">
  <div class="form-group">
    <input id="test1" class="form-control" type="text" name="pname" th:value="${person.pname}" placeholder="用户名/手机号">
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">角色</label>
    <div class="col-sm-12">
      <div th:each="role : ${list}">
        <input type="checkbox" th:value="${role.roleId}" th:checked="${ids.contains(role.roleId)}" name="roleId">[[${role.roleName}]]
      </div>
    </div>
  </div>
</form>
</body>
</html>